home *** CD-ROM | disk | FTP | other *** search
- # include "BlobMgr.h"
-
-
-
-
- /* -------------------------------------------------------------------- */
- /* Blob Hit Testing Routines */
- /* -------------------------------------------------------------------- */
-
-
- /*
- * Test whether the blob contains the point, and if so, return a part
- * of the part of the blob that the point is in. Does not consider
- * dimmed parts of blobs. Blob must be active (enabled, not frozen).
- * Return zero if no hit.
- */
-
- pascal short
- TestBlob (BlobHandle b, Point thePoint)
- {
- short result;
-
- result = 0;
- if (BlobActive (b))
- {
- if (!BlobDimmed (b, inDragBlob) && PtInRgn (thePoint, (**b).dragRgn))
- result = inDragBlob;
- else if (!BlobDimmed (b, inStatBlob)
- && PtInRgn (thePoint, (**b).statRgn))
- result = inStatBlob;
- }
- return (result);
- }
-
-
- /*
- * If the point is in an undimmed region of any active blob of the set,
- * return a handle to the blob in b and the part code as the function
- * result.
- */
-
- pascal short
- FindBlob (Point thePoint, BlobSetHandle bSet, BlobHandle *bPtr)
- {
- BlobHandle b;
- short partCode;
- short result;
-
- result = 0;
- for (b = FirstBlob (bSet); b != nil; b = NextBlob (b))
- {
- partCode = TestBlob (b, thePoint);
- if (partCode != 0)
- {
- result = partCode;
- *bPtr = b;
- break;
- }
- }
- return (result);
- }
-